#include <iostream>

typedef int(*counter)(int x, int y);

int add(int x, int y){return x + y;}
int sub(int x, int y){return x - y;}
int mul(int x, int y){return x * y;}
int dev(int x, int y){return x / y;}

int main()
{
    printf("请输入：\n");
    char ch;
    int x;
    int y;
    scanf("%d %c %d", &x, &ch, &y);

    counter functions[4] = {add, sub, mul, dev};

    if(ch == '+')
    {
        std::cout << functions[0](x, y);
    }
    else if(ch == '-')
    {
        std::cout << functions[1](x, y);
    }
    else if(ch == '*')
    {
        std::cout << functions[2](x, y);
    }
    else if(ch == '/')
    {
        std::cout << functions[3](x, y);
    }
    else 
    {
        printf("bad input\n");
    }
    return 0;
}